package com.google.precinct.common;

import java.io.Serializable;

import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.ui.SuggestOracle;

public class CityItem implements SuggestOracle.Suggestion, Serializable {

	private static final long serialVersionUID = -5955732209552448436L;

	private String region;
	private String provinceKey;
	private String cityKey;
	private String cityProvinceName;
	private long voterCount;

	public CityItem() {
	}

	public CityItem(String region, String cityProvinceName, long voterCount) {
		super();
		this.region = region;
		this.cityProvinceName = cityProvinceName;
		this.voterCount = voterCount;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public void setCityProvinceName(String cityProvinceName) {
		this.cityProvinceName = cityProvinceName;
	}

	public void setVoterCount(long voterCount) {
		this.voterCount = voterCount;
	}

	public String getRegion() {
		return region;
	}

	public String getCityProvinceName() {
		return cityProvinceName;
	}

	public long getVoterCount() {
		return voterCount;
	}

	@Override
	public String getDisplayString() {
		return cityProvinceName.replace("?", "ñ") + "  &nbsp;<span class=\"votersCount\">" +
				NumberFormat.getDecimalFormat().format(voterCount) + " voters</span>";
	}

	@Override
	public String getReplacementString() {
		return cityProvinceName.replace("?", "ñ");
	}

	public String getProvinceKey() {
		return provinceKey;
	}

	public void setProvinceKey(String provinceKey) {
		this.provinceKey = provinceKey;
	}

	public String getCityKey() {
		return cityKey;
	}

	public void setCityKey(String cityKey) {
		this.cityKey = cityKey;
	}



}
